<template>
  <view class="update-page">
    <!-- 顶部栏 -->
    <view class="header">
      <text class="back" @click="onBack">&#60;</text>
      <text class="title">更新健康数据</text>
    </view>

    <!-- 身高 -->
    <view class="form-group">
      <text class="label bold">身高（cm）</text>
      <input
        class="input"
        type="number"
        v-model="height"
        placeholder="输入身高信息"
      />
    </view>

    <!-- 体重 -->
    <view class="form-group">
      <text class="label bold">体重（kg）</text>
      <input
        class="input"
        type="number"
        v-model="weight"
        placeholder="请输入姓名"
      />
    </view>

    <!-- 血压 -->
    <view class="form-group">
      <text class="label bold">血压（mmHg）</text>
      <input class="input" v-model="bp" placeholder="血压信息" />
    </view>

    <!-- 血糖 -->
    <view class="form-group">
      <text class="label bold">血糖（mmol/L）</text>
      <input class="input" v-model="sugar" placeholder="血糖信息" />
    </view>

    <!-- 确认按钮 -->
    <view class="btn-wrap">
      <button class="submit-btn" @click="onSubmit">确认更新</button>
    </view>
  </view>
</template>

<script setup lang="ts">
import { ref } from "vue";

const height = ref("");
const weight = ref("");
const bp = ref("");
const sugar = ref("");

const onBack = () => {
  uni.navigateBack();
};
const onSubmit = () => {
  // 这里可以加校验逻辑
  uni.navigateTo({ url: "/pages/profile/profile" });
};
</script>

<style scoped>
.update-page {
  background: #fff;
  min-height: 100vh;
  padding: 0 0 40rpx 0;
}
.header {
  display: flex;
  align-items: center;
  height: 100rpx;
  background: #fff;
  box-shadow: 0 8rpx 24rpx rgba(25, 195, 60, 0.08);
  padding: 0 32rpx;
  position: relative;
}
.back {
  font-size: 48rpx;
  color: #19c37c;
  font-weight: bold;
  margin-right: 24rpx;
  cursor: pointer;
}
.title {
  font-size: 36rpx;
  color: #19c37c;
  font-weight: bold;
}
.form-group {
  margin: 0 32rpx 0 32rpx;
  border-bottom: 2rpx solid #19c37c;
  padding: 32rpx 0 0 0;
}
.label {
  font-size: 30rpx;
  font-weight: bold;
  color: #333;
  margin-bottom: 8rpx;
  display: block;
}
.input {
  width: 100%;
  border: none;
  background: none;
  font-size: 28rpx;
  color: #333;
  margin: 8rpx 0 0 0;
  outline: none;
}
.btn-wrap {
  margin: 64rpx 32rpx 0 32rpx;
}
.submit-btn {
  width: 100%;
  height: 88rpx;
  background: #19c37c;
  color: #fff;
  font-size: 36rpx;
  font-weight: bold;
  border-radius: 16rpx;
  box-shadow: 0 8rpx 24rpx rgba(25, 195, 60, 0.18);
  border: none;
}
</style> 